Path: blob/master/Part 2 - Regression/Support Vector Regression (SVR)/[Python] Support Vector Regression (SVR).ipynb
1009 views
Kernel: Python 3
Support Vector Regression (SVR)
Data Preprocessing
In [72]:
In [73]:
Out[73]:
/home/baka/Programs/anaconda3/lib/python3.6/site-packages/sklearn/utils/validation.py:475: DataConversionWarning: Data with input dtype int64 was converted to float64 by StandardScaler.
warnings.warn(msg, DataConversionWarning)
In [74]:
Out[74]:
array([[-1.5666989 ],
[-1.21854359],
[-0.87038828],
[-0.52223297],
[-0.17407766],
[ 0.17407766],
[ 0.52223297],
[ 0.87038828],
[ 1.21854359],
[ 1.5666989 ]])
In [75]:
In [76]:
Out[76]:
array([-0.72004253, -0.70243757, -0.66722767, -0.59680786, -0.49117815,
-0.35033854, -0.17428902, 0.17781001, 0.88200808, 2.64250325])
Fitting the SVR Model to the dataset
In [77]:
Out[77]:
SVR(C=1.0, cache_size=200, coef0=0.0, degree=3, epsilon=0.1, gamma='auto',
kernel='rbf', max_iter=-1, shrinking=True, tol=0.001, verbose=False)
Predicting a new result
In [79]:
Out[79]:
array([ 170370.0204065])
Visualising the Regression results
In [80]:
Out[80]:
Text(0,0.5,'Salary')
More continuous visualization
In [81]:
Out[81]:
The observation point for CEO is considered as an outlier. This is because the CEO has a much higher Salary then the other Level
In [ ]: